const mongoose = require('mongoose')

const TokenBlacklistSchema = new mongoose.Schema(
  {
    token: {
      type: String,
      required: true,
      unique: true
    },
    createdAt: {
      type: Date,
      default: Date.now,
      expires: '7d' // Token在7天后自动过期
    }
  },
  { timestamps: true }
)

module.exports = mongoose.model('TokenBlacklist', TokenBlacklistSchema)
